home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BKISSSRC.ZIP / CREDITS / CREDITS.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-02-17  |  7.1 KB  |  204 lines

  1. ideal
  2. locals
  3. jumps
  4. model huge
  5. stack 100h
  6. p386
  7.  
  8. TextMode = 0
  9. ScrollRate = 4
  10. Heart1XAngleInc = 14
  11. Heart1YAngleInc = 12
  12. Heart2XAngleInc = 13
  13. Heart2YAngleInc = 15
  14. TinyHeartHeight = 64
  15. TinyHeartWidth = 64
  16.  
  17. segment     MyData
  18. ScrollText  db "            well all good things must come to an end...  "
  19.             db "greets go out to joakim rosqvist (dr.hex), andrew welch, "
  20.             ;db "gavin, "
  21.             db "gavin scarman, "        ;(happy Gavin?)
  22.             db "kim davies, patch, jason williams, phil carlisle, "
  23.             db "james torrance, michael j. black, and everyone else who "
  24.             db "enjoyed my last demo!  i'd also like to say hi to everyone "
  25.             db "else in the pc demo scene.  bye for now!",0
  26. ScrollCol   dw 0
  27. Heart1_x    dw 135
  28. Heart1_y    dw 50
  29. Heart2_x    dw 618
  30. Heart2_y    dw 835
  31. VisualPage  dw ?                    ;offset of visual page
  32. HiddenPage  dw ?                    ;offset of hidden page
  33. CurrentPal  db 256 dup(0,0,0)       ;a black palette
  34. include     "hartpath.inc"          ;heights of different levels in bitmap
  35. include     "sincos.inc"            ;our sine/cosine table
  36. extrn       PaletteData:byte        ;this should be a RGB triplet palette
  37. extrn       FontData:byte           ;this should be a valid JLF font
  38. extrn       TinyHeartData:byte      ;this should have the above dimensions
  39. ends        MyData
  40.  
  41. segment     BitmapSeg
  42. extrn       BigHeartData:byte       ;this should be a 320x200x256 bitmap
  43. ends        BitmapSeg
  44.  
  45. segment     MyCode
  46.             assume cs:MyCode, ds:MyData
  47. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  48. FadeHandler = RefreshScreen
  49. include     "palette.inc"
  50. include     "modex.inc"
  51. include     "drawstrx.inc"
  52. include     "bitmap.inc"
  53. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  54. proc        Start
  55.             ;set up all of the segments
  56.             cld
  57.             mov ax,MyData
  58.             mov ds,ax
  59.  
  60.             ;switch over to graphics mode
  61.             @SetModeX M320x200x256,320
  62.             ScreenWidth = 320
  63.             ScreenHeight = 200
  64.             PageSize = (ScreenWidth*ScreenHeight)/4
  65.             mov [VisualPage],0
  66.             mov [HiddenPage],PageSize
  67.  
  68.             ;load in the palette
  69.             mov si,offset CurrentPal
  70.             mov di,offset PaletteData
  71.             call fade_to
  72.  
  73. @@MainLoop: call RefreshScreen
  74.             jc @@AllDone
  75.  
  76.             ;get stdio.  If something's been pressed, quit
  77.             mov ah,6
  78.             mov dl,0FFh
  79.             int 21h
  80.             jz @@MainLoop
  81.  
  82. @@AllDone:  call fade_out
  83.  
  84.             ;change back to text mode and quit
  85.             if TextMode ne 0
  86.                 mov ax,0003h
  87.                 int 10h
  88.             endif
  89.             mov ax,4C00h
  90.             int 21h
  91. endp        Start
  92. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  93. proc        RefreshScreen
  94.             ;wait for a retrace to complete (for timing)
  95.             @WaitVertEnd
  96.  
  97.             ;reset the starting offset
  98.             mov bx,[VisualPage]
  99.             @Set_Start_Offset
  100.  
  101.             ;wait for a retrace to start (for timing)
  102.             @WaitVert
  103.  
  104.             ;display the heart background (wipes out entire screen)
  105.             mov ax,BitmapSeg
  106.             mov fs,ax
  107.             mov si,offset BigHeartData
  108.             mov bx,[HiddenPage]
  109.             call DisplayBitmap
  110.  
  111.             ;display the text
  112.             push [HiddenPage]
  113.             push [ScrollCol]
  114.             push (seg ScrollText) (offset ScrollText)
  115.             push (seg FontData) (offset FontData)
  116.             call Draw_String
  117.             add sp,12
  118.             add [ScrollCol],ScrollRate
  119.             push ax
  120.  
  121.             ;draw on the hearts
  122.             call DrawHearts
  123.             
  124.             ;flip to the next page
  125.             mov ax,[VisualPage]
  126.             xchg [HiddenPage],ax
  127.             mov [VisualPage],ax
  128.  
  129.             pop ax
  130.             or ax,ax
  131.             jnz @@EndText
  132.  
  133.             clc
  134.             ret
  135.  
  136. @@EndText:  stc
  137.             ret
  138. endp        RefreshScreen
  139. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  140. proc        DrawHearts
  141.             ;calculate the position and draw it
  142.             push (seg TinyHeartData) (offset TinyHeartData)
  143.             push TinyHeartHeight TinyHeartWidth
  144.             push [HiddenPage]
  145.             mov si,[Heart1_y]                               ;\
  146.             shl si,1                                        ; \
  147.             movsx eax,[Sine+si]                             ;  \
  148.             sal eax,8                                       ;   > AX = row
  149.             imul eax,eax,(ScreenHeight-TinyHeartHeight)/2   ;  /
  150.             shr eax,16                                      ; /
  151.             add ax,(ScreenHeight-TinyHeartHeight)/2         ;/
  152.             push ax
  153.             mov si,[Heart1_x]                               ;\
  154.             shl si,1                                        ; \
  155.             movsx eax,[Cosine+si]                           ;  \
  156.             sal eax,8                                       ;   > AX = column
  157.             imul eax,eax,(ScreenWidth-TinyHeartWidth)/2     ;  /
  158.             shr eax,16                                      ; /
  159.             add ax,(ScreenWidth-TinyHeartWidth)/2           ;/
  160.             push ax
  161.             call add_bitmap
  162.             add sp,14
  163.  
  164.             ;update the angles
  165.             add [Heart1_x],Heart1XAngleInc
  166.             and [Heart1_x],1023
  167.             add [Heart1_y],Heart1YAngleInc
  168.             and [Heart1_y],1023
  169.  
  170.             ;calculate the position
  171.             push (seg TinyHeartData) (offset TinyHeartData)
  172.             push TinyHeartHeight TinyHeartWidth
  173.             push [HiddenPage]
  174.             mov si,[Heart2_y]                               ;\
  175.             shl si,1                                        ; \
  176.             movsx eax,[Sine+si]                             ;  \
  177.             sal eax,8                                       ;   > AX = row
  178.             imul eax,eax,(ScreenHeight-TinyHeartHeight)/2   ;  /
  179.             shr eax,16                                      ; /
  180.             add ax,(ScreenHeight-TinyHeartHeight)/2         ;/
  181.             push ax
  182.             mov si,[Heart2_x]                               ;\
  183.             shl si,1                                        ; \
  184.             movsx eax,[Cosine+si]                           ;  \
  185.             sal eax,8                                       ;   > AX = column
  186.             imul eax,eax,(ScreenWidth-TinyHeartWidth)/2     ;  /
  187.             shr eax,16                                      ; /
  188.             add ax,(ScreenWidth-TinyHeartWidth)/2           ;/
  189.             push ax
  190.             call add_bitmap
  191.             add sp,14
  192.  
  193.             ;update the angles
  194.             add [Heart2_x],Heart2XAngleInc
  195.             and [Heart2_x],1023
  196.             add [Heart2_y],Heart2YAngleInc
  197.             and [Heart2_y],1023
  198.  
  199.             ret
  200. endp        DrawHearts
  201. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  202. ends        MyCode
  203.             end     Start
  204.